package com.qf.ithub.user.controller.api;


import com.qf.ithub.common.result.R;
import com.qf.ithub.common.result.ResponseEnum;
import com.qf.ithub.user.entity.User;
import com.qf.ithub.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user")
@Api(description = "对外使用的用户接口")
public class ApiUserController {

    @Autowired
    private UserService userService;

    /**
     *  添加一个user
     */
    @PostMapping("/add")
    public R<User> findUserByid(@RequestBody User user){

       userService.addUser(user);
       return new R(ResponseEnum.SUCCESS,null);
    }
}
